@import "/assets/common.less";

.outline-display-page {
  position: relative;
  width: 100%;
  height: 100vh;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 20rpx;
}

.navigation-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 94%;
    // margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    z-index: 1000;
    padding: 0 3%;
    box-sizing: border-box;
    .iconfont {
        font-size: 24px;
      }
      .logo{
        width: 245rpx;
        height: 70rpx;
      }
    }
  /* 导航栏中间区域 */
.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1; /* 占据中间空间 */
}
  
  .page-title {
    position: absolute;
    width: auto;
    max-width: calc(100% - 64rpx);
    min-height: 48rpx;
    height: auto;
    top: 190rpx;
    left: 32rpx;
    right: 32rpx;
    font-family: 'Noto Sans SC', sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 32rpx;
    line-height: 1.5;
    letter-spacing: 1.36rpx;
    text-align: center;
    color: #0A4CE9;
    word-wrap: break-word;
    word-break: break-all;
    padding: 10rpx 20rpx;
    box-sizing: border-box;
    overflow: visible;
    white-space: normal;
    z-index: 10; // 确保在最上层，不被 content-container 遮挡
    background-color: #fff; // 添加背景色，避免被下方内容透过
  }

.content-container {
  flex: 1;
  padding: 40rpx 32rpx;
  padding-top: 180rpx; // 增加顶部内边距，为可能的多行标题留出足够空间（pageTitle top: 190rpx + 标题高度）
  margin-top: 0; // 移除 margin-top，改用 padding-top
  overflow-y: auto;
  position: relative; // 确保 z-index 生效
  z-index: 1; // 确保在 pageTitle 下方
}

.loading-container {
  position: absolute;
  top: 300rpx; // 增加顶部间距，确保即使page-title换行也不会被遮挡（190rpx + 标题高度约170rpx）
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16rpx;
  z-index: 1; // 确保在page-title下方
  
  .loading-text {
    font-size: 24rpx;
    color: #666;
  }
}

.outline-text-container {
  position: absolute;
  top: 320rpx; // 增加顶部间距，避免被page-title遮挡
  left: 32rpx;
  width: 686rpx;
  bottom: 140rpx; // 为action-buttons留出空间
  display: flex;
  flex-direction: column;
  height: calc(100vh - 460rpx); // 调整高度以适应新的顶部位置
}

// 上方区域：full-text-content（可滚动）
.full-text-scroll {
  flex: 1;
  width: 100%;
  font-size: 28rpx;
  line-height: 1.6;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
  padding-top: 20rpx;
  padding-bottom: 20rpx; // 基础padding
  overflow-y: auto;
  margin-bottom: 0;
  
  // 当存在reasoning-content时，增加底部padding避免被遮挡
  &.has-reasoning {
    padding-bottom: 332rpx; // 20rpx基础padding + 292rpx（reasoning-scroll高度）+ 20rpx间距，确保不被遮挡
  }
  
  .generating-content {
    font-size: 28rpx;
    line-height: 1.6;
    color: #333;
  }
  
  .legacy-content {
    font-size: 28rpx;
    line-height: 1.6;
    color: #333;
  }
}

// 下方区域：reasoning-content（固定在action-buttons上方，高度146px，自动滚动）
.reasoning-scroll {
  position: fixed;
  bottom: 148rpx; // action-buttons高度88rpx + 底部40rpx + 间距20rpx = 148rpx
  left: 32rpx;
  width: 686rpx;
  height: 292rpx; // 146px = 292rpx
  background: transparent;
  overflow-y: auto;
  z-index: 99; // 确保在action-buttons上方但在其他内容下方
  
  .reasoning-content {
    background: #E3E8FC;
    padding: 20rpx;
    border-radius: 8rpx;
    font-size: 28rpx;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 100%;
  }
}

.generating-content {
  font-size: 28rpx;
  line-height: 1.6;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
  
  // Markdown 标题样式
  /deep/ .markdown-h1 {
    font-size: 40rpx !important;
    font-weight: bold !important;
    margin: 30rpx 0 15rpx 0 !important;
    color: #333 !important;
    line-height: 1.5 !important;
    display: block !important;
  }
  
  /deep/ .markdown-h2 {
    font-size: 36rpx !important;
    font-weight: bold !important;
    margin: 24rpx 0 12rpx 0 !important;
    color: #333 !important;
    line-height: 1.5 !important;
    display: block !important;
  }
  
  /deep/ .markdown-h3 {
    font-size: 32rpx !important;
    font-weight: bold !important;
    margin: 20rpx 0 10rpx 0 !important;
    color: #333 !important;
    line-height: 1.5 !important;
    display: block !important;
  }
  
  // Markdown 列表项样式
  // 注意：rich-text 组件可能不支持 ::before 伪元素，所以我们直接在 HTML 中添加项目符号
  /deep/ .markdown-list-item {
    margin: 8rpx 0 !important;
    padding-left: 0 !important;
    display: block !important;
    line-height: 1.8 !important;
    position: relative !important;
  }
  
  /deep/ .markdown-list-item-indent {
    margin: 6rpx 0 6rpx 40rpx !important;
    padding-left: 0 !important;
    display: block !important;
    line-height: 1.8 !important;
    position: relative !important;
  }
  
  // 加粗文本样式
  /deep/ strong {
    font-weight: bold !important;
    color: #333 !important;
  }
  
  // LaTeX 公式图片样式
  /deep/ .latex-formula {
    vertical-align: middle;
    max-width: 100%;
    display: inline-block;
    margin: 0 2rpx;
  }
}

  .legacy-content {
    font-size: 28rpx;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
  }
  
  .full-text-content {
    font-size: 28rpx;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
    padding-left: 24rpx;
    padding-right: 24rpx;
    
    // Markdown 标题样式
    /deep/ .markdown-h1 {
      font-size: 40rpx !important;
      font-weight: bold !important;
      margin: 30rpx 0 15rpx 0 !important;
      color: #333 !important;
      line-height: 1.5 !important;
      display: block !important;
    }
    
    /deep/ .markdown-h2 {
      font-size: 36rpx !important;
      font-weight: bold !important;
      margin: 24rpx 0 12rpx 0 !important;
      color: #333 !important;
      line-height: 1.5 !important;
      display: block !important;
    }
    
    /deep/ .markdown-h3 {
      font-size: 32rpx !important;
      font-weight: bold !important;
      margin: 20rpx 0 10rpx 0 !important;
      color: #333 !important;
      line-height: 1.5 !important;
      display: block !important;
    }
    
    // 有序列表样式 - 隐藏自动序号，只显示文本中的序号
    /deep/ .h2w__ol {
      margin: 16rpx 0 !important;
      padding-left: 0 !important;
      list-style: none !important; // 隐藏自动序号
      
      /deep/ .h2w__li {
        margin: 8rpx 0 !important;
        padding-left: 0 !important;
        display: block !important; // 强制改为block，覆盖towxml的list-item样式
        list-style: none !important; // 隐藏自动序号
        line-height: 1.8 !important;
        
        // 确保列表项内容正常显示（包含文本中的序号）
        /deep/ .h2w__p {
          margin: 0 !important;
          display: block !important;
          line-height: 1.8 !important;
        }
        
        // 确保所有文本内容都显示
        /deep/ text,
        /deep/ .h2w__text {
          display: inline !important;
          visibility: visible !important;
          opacity: 1 !important;
        }
      }
    }
    
    // 全局覆盖h2w__li的list-item样式
    /deep/ .h2w__li {
      display: block !important;
      list-style: none !important;
      
      // 确保文本内容可见
      /deep/ text,
      /deep/ .h2w__text {
        display: inline !important;
        visibility: visible !important;
        opacity: 1 !important;
      }
    }
    
    // Markdown 列表项样式
    /deep/ .markdown-list-item {
      margin: 8rpx 0 !important;
      padding-left: 32rpx !important;
      position: relative !important;
      display: block !important;
      line-height: 1.6 !important;
      
      &::before {
        content: '•' !important;
        position: absolute !important;
        left: 8rpx !important;
        color: #666 !important;
        font-weight: bold !important;
      }
    }
    
    /deep/ .markdown-list-item-indent {
      margin: 6rpx 0 6rpx 40rpx !important;
      padding-left: 32rpx !important;
      position: relative !important;
      display: block !important;
      line-height: 1.6 !important;
      
      &::before {
        content: '◦' !important;
        position: absolute !important;
        left: 8rpx !important;
        color: #999 !important;
      }
    }
    
    // 加粗文本样式
    /deep/ strong {
      font-weight: bold !important;
      color: #333 !important;
    }
    
    // LaTeX 公式组件样式
    /deep/ .latex-formula,
    /deep/ latex {
      vertical-align: middle !important;
      max-width: 100% !important;
      display: inline-block !important;
      margin: 0 4rpx !important;
      
      image {
        vertical-align: middle !important;
        max-width: 100% !important;
        height: auto !important;
      }
    }
    
    // 行内公式样式
    /deep/ .latex-formula--line,
    /deep/ latex[type="line"] {
      display: inline !important;
      vertical-align: baseline !important;
    }
    
    // 块级公式样式
    /deep/ .latex-formula--block,
    /deep/ latex[type="block"] {
      display: block !important;
      margin: 20rpx 0 !important;
      text-align: center !important;
    }
  }

.empty-state {
  position: absolute;
  top: 280rpx; // 下移以适应可能的多行标题
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: 80rpx 0;
  color: #999;
  font-size: 28rpx;
}

.action-buttons {
  position: fixed;
  bottom: 40rpx;
  left: 32rpx;
  right: 32rpx;
  display: flex;
  justify-content: center;
  z-index: 100;
  
  .action-btn {
    width: 346rpx;
    height: 88rpx;
    border-radius: 44rpx;
    font-size: 32rpx;
    font-weight: 500;
    border: none;
    
    &.secondary {
      background: #F2F2F2;
      color: #666;
    }
    
    &.primary {
      background: #5C83E7;
      color: #fff;
    }
    
    &.disabled,
    &[disabled] {
      background: #CCCCCC !important;
      color: #999 !important;
      opacity: 1 !important;
    }
    
    &:disabled {
      background: #CCCCCC !important;
      color: #999 !important;
      opacity: 1 !important;
    }
  }
}


/* 复用 writing 页的选项卡样式 */
.options-container {
  margin-top: 24rpx;
  width: 686rpx;
  margin-left: auto;
  margin-right: auto;
  background: #F4F4F5;
  border-radius: 8px;
  overflow: hidden;
}

.option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32rpx 32rpx;
  border-bottom: 1px solid #E0E0E0;
}

.option-row:last-child {
  border-bottom: none;
}

.option-label {
  font-size: 32rpx;
  color: #333333;
  font-weight: 400;
}

.option-value {
  display: flex;
  align-items: center;
  gap: 16rpx;
}

.value-text {
  font-size: 28rpx;
  color: #ACACAC;
}

.icon-arrow-right {
  font-size: 24rpx;
  color: #ACACAC;
}

/* 保存完成后的网页引导提示样式 */
.web-guide-section {
  position: fixed;
  bottom: 148rpx;
  left: 32rpx;
  right: 32rpx;
  background: #FFF7E6;
  border: 1px solid #FFE7BA;
  color: #AD6800;
  border-radius: 8rpx;
  padding: 16rpx;
  z-index: 101;
}
.web-guide-text {
  font-size: 24rpx;
  line-height: 1.6;
}
